public class Text2 {
    public static void main(String[] args) {
        Animal animal2 = new Bird("小鸟" ,10);
        if (animal2 instanceof Bird) {
            Bird bird = (Bird) animal2;
            bird.fly();
        }
        Animal animal1 = new Dog("小狗" ,10);
        if (animal1 instanceof Bird) {
            Bird bird2 = (Bird) animal1;
            bird2.fly();
        }else {
            System.out.println("不能飞 ");
        }
    }
}
class Animal {
    public String name;
    public int age;
    public Animal(String name, int age) {
        this.age = age;
        this.name = name;
    }
    Animal eat() {
        System.out.println(name + " 正在吃 ");
        return mu11;
    }
    @Override
    public String toString() {
        return "Animal{" +
                "name=" + name + '\'
    }
}